<?php
	header("content-type:text/html;charset = utf-8");
	$pdo = new PDO("mysql:host=127.0.0.1;dbname=goods","root","root");
	$redis = new Redis();
	$redis->connect("127.0.0.1","6379");
	$id = $_GET['id'];
	$sql = "select * from excel where id=$id";
	$data = $pdo->query($sql)->fetch();
	if($redis->get("visit".$id)){
		$redis->incr("visit".$id);
	}else{
		$redis->set("vivit".$id,1);
		$visit = $redis->get("visit".$id);
	}
	?>
	<!DOCTYPE html>
	<html lang="en">
	<head>
		<meta charset="UTF-8">
		<title>Document</title>
	</head>
	<body>
		<center>
			这是你第<?php echo $visit;?>次访问此商品
			<table>
				<tr>
					<td>商品名</td>
					<td>价格</td>
					<td>数量</td>
				</tr>
				<tr>
					<td><?php echo $data['name']?></td>
					<td><?php echo $data['money']?></td>
					<td>100</td>
				</tr>
			</table>
		</center>
	</body>
	</html>